<p>
<?php

$record = isset($this->record)? $this->record : array('title'=>'', 'body'=>'');

if (isset($this->messages)) {
    foreach ($this->messages as $field => $messages) {
        foreach ($messages as $message) {
            echo $this->escape($message) . "<br />\n";
        }        
    }
}

?>
<a href="<?php echo $this->baseUrl; ?>/admin/news">Lists</a> |
<a href="<?php echo $this->baseUrl; ?>/admin/news/add">Add</a> |
<a href="<?php echo $this->baseUrl; ?>/admin/news/delete<?php echo (isset($record['id']) && $record['id'])? "/id/{$record['id']}" : ""; ?>">Delete</a>
<form action="<?php echo $this->baseUrl ?>/admin/news/edit<?php echo (isset($record['id']) && $record['id'])? "/id/{$record['id']}" : ""; ?>" method="POST">
<table cellpadding="2" cellspacing="2">
	<tr>
		<td align="right">Id:</td>
		<td><em>
			<?php
			echo (isset($record['id']) && $record['id'])? $record['id'] : 'Autogenerated'; 
			?></em>
		</td>
	</tr>
	<tr>
		<td align="right" valign="top">Title</td>
		<td><input type="text" name ="title" value="<?php echo $record['title']; ?>" /></td>
	</tr>
	<tr>
		<td align="right" valign="top">Body</td>
		<td><textarea name ="body" rows="10" cols="50"><?php echo $record['body']; ?></textarea></td>
	</tr>
	<tr>
		<td align="right">&nbsp;</td>
		<td>
			<input type="submit" name="btnSave" value="Save">
			<input type="submit" name="btnCancel" value="Cancel">
		</td>
	</tr>
</table>
</form>
</p>